package com.jingtai.validate.regex;

import java.util.regex.Pattern;

public final class DataPattern {
	public static final String EMAIL_PATTERN = new String(
			"\\w+([-+.]\\w+)*@([a-z0-9A-Z]+)([-.]\\w+)*\\.\\w+([-.]\\w+)*");
	public static final String PHONE_PATTERN = new String("^((1[35]\\d{9})|(0\\d{2,3}-\\d{7,8}(-\\d{1,4})?)$)");
	public static final String MOBILE_PATTERN = new String("(1[35]\\d{9})");
	public static final String QQ_PATTERN = new String("[1-9]\\d{4,11}");
	public static final String URL_PATTERN = new String(
			"^(\\s)*(http(s)?://)?([\\w-]+\\.)+[\\w-]+(:(\\d{1,4}))?(/[\\w-./?%&=]*)?(\\s)*$");
	public static final String IDCARD_PATTERN = new String("^(\\s)*(\\d{15}|\\d{18}|\\d{7}x)(\\s)*$/i");
	public static final String ZIPCODE_PATTERN = new String("^\\d{6}$");
	public static final String PASSWORD_PATTERN = new String("^[a-zA-Z\\-0-9\\_]+$");
	public static final String AGREEMENT_PATTERN = new String("on");
	public static final String CN_EN_PATTERN = new String("([a-zA-Z\\u4E00-\\u9FFF\\u00B7\\s])+");
	public static final String CN_EN_KUOHAO_PATTERN = new String("([\\(\\)\\（\\）a-zA-Z\\u4E00-\\u9FFF\\u00B7\\s])+");
	public static final String CN_PATTERN = new String("[\\u4E00-\\u9FFF\\u00B7]+");
	public static final String EN_SPACE_PATTERN = new String("[a-zA-Z\\s]+");
	public static final String EN_NUM_SPACE_PATTERN = new String("[a-zA-Z\\s0-9]+");
	public static final String FAX_PATTERN = new String("^[\\s]*(0\\d{2,4}\\-){1}[1-9]{1}\\d{6,9}[\\s]*$");
	public static final String CN_EN_NUM_SPACE = new String("[0-9a-zA-Z\\u4E00-\\u9FFF\\s]+");
	public static final String FLOAT_PATTERN = new String("([-\\+]?\\d{1,8}(\\.\\d{1,2})?)");
	public static final String EN_NUM_PATTERN = new String("[0-9a-zA-Z]+");

	public static void main(String[] args) {
		System.out.println(Pattern.matches(URL_PATTERN, "https://www.sina.com?de=aa&a=树"));
		System.out.println(Pattern.matches(MOBILE_PATTERN, "13501972866"));
		System.out.println(Pattern.matches(ZIPCODE_PATTERN, "４１０００１"));
	}
}